package com.cg.controller;

import com.cg.dto.Result;
import com.cg.dto.ResultUtils;
import com.cg.service.OperateTokenServiceImpl;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName OperateTokenController
 * @Description 获取Token信息
 * @Author CG
 * @Date 2023/12/1 13:31
 **/
@RestController
@RequestMapping("/operate")
public class OperateTokenController {

    @Resource
    private OperateTokenServiceImpl operateTokenService;

    /**
     * 获取Token信息并且保存到redis中
     * @return
     */
    @PostMapping("/getOperateToken")
    public Result<String> getOperateToken(){
        String operateToken = operateTokenService.getOperateToken();
        return ResultUtils.returnDataSuccess(operateToken);
    }
}
